<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ include file="/WEB-INF/views/include/header.jsp"%>
<style>
	.input-no-wrap .input-group[class*="col-"]{
		float: left;
	}
	.error {
		color: red;
	}
</style>

<form:form commandName="summaryFilter" cssClass="form-horizontal"
	role="form" onsubmit="return false;">
	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right" for="teamClass">组别</label>

		<div class="col-sm-4">
			<select name="teamId" class="form-control " style="width: 100%"
					data-placeholder="组别" id="team-ClassId" onchange="findtwoClass()">
				<option value="${summaryFilter.teamId }">${summaryFilter.teamClass }</option>
				<c:forEach items="${teamClass}" var="teamClass">
					<option value="${teamClass.teamId }">${teamClass.teamClass }</option>
				</c:forEach>
			</select>
		</div>
		<div>
			<label class="col-sm-2 control-label no-padding-right"
				   for="teamClass">小分队</label>
			<div class="col-sm-4">
				<select name="teamName" class="form-control " style="width: 100%"
						data-placeholder="请选择分类" id="team-name">
					<option value="${summaryFilter.teamName }">${summaryFilter.teamName }</option>
				</select>
			</div>
		</div>
	</div>
<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="projectStage">项目阶段</label>
		<div class="col-sm-4">
			<select name="projectStage" class="form-control "
				style="width: 100%" data-placeholder="请选择项目阶段"
				id="projectStage">
				<option value="${summaryFilter.projectStage }">${summaryFilter.projectStage }</option>


				<option value="意向项目">意向项目</option>
				<option value="在谈项目">在谈项目</option>
				<option value="评审项目">评审项目</option>
				<option value="签约项目">签约项目</option>
				<option value="已备案">已备案</option>
				<option value="已注册">已注册</option>
				<option value="审批项目">审批项目</option>
			<%--	<option value="落地项目">落地项目</option>--%>
				<option value="在建项目">在建项目</option>
				<option value="投产项目">投产项目</option>
			</select>
		</div>
		
		<label class="col-sm-2 control-label no-padding-right"
			for="projectClass">项目类别</label>
		<div class="col-sm-4">
			<%-- <input type="text" name="projectStage" id="projectStage" placeholder="请选择项目类别" value="${summaryFilter.projectStage}" class="form-control "> --%>
			<select name="projectClass" class="form-control " style="width: 100%"
				data-placeholder="请选择项目类别" id="projectClass">
				<option value="${summaryFilter.projectClass }">${summaryFilter.projectClass }</option>
				<option value="">无</option>
				<option value="大项目、好项目">大项目、好项目</option>
				<option value="一般项目">一般项目</option>
			</select>
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="projectName">项目名称</label>
		<div class="col-sm-4">
			<input type="text" name="projectName" id="projectName"
				placeholder="请输入项目名称" value="${summaryFilter.projectName}"
				class="form-control ">
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			for=investorName>投资方名</label>
		<div class="col-sm-4">
			<input type="text" name="investorName" id="investorName"
				placeholder="请输入投资方名称" value="${summaryFilter.investorName}"
				class="form-control ">
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="dockingTown">乡（镇）</label>
		<div class="col-sm-4">
			<input type="text" name="dockingTown" id="dockingTown"
				placeholder=" 面对负责对接的单位或部门的乡镇" value="${summaryFilter.dockingTown}"
				class="form-control ">
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			for=dockingCounty>县直单位</label>
		<div class="col-sm-4">
			<input type="text" name="dockingCounty" id="dockingCounty"
				placeholder="面对负责对接的单位或部门的县直、市直单位 "
				value="${summaryFilter.dockingCounty}" class="form-control ">
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right" for="leader">领导</label>
		<div class="col-sm-4">
			<input type="text" name="leader" id="leader" placeholder=" 请输入领导"
				value="${summaryFilter.leader}" class="form-control ">
		</div>

		<label class="col-sm-2 control-label no-padding-right" for=belongArea>归属地</label>
		<div class="col-sm-4">
			<input type="text" name="belongArea" id="belongArea"
				placeholder="请输入归属地" value="${summaryFilter.belongArea}"
				class="form-control ">
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="projectContent">项目内容和规模</label>
		<div class="col-sm-4">
			<%-- <input type="text" name="projectContent" id="projectContent" placeholder="项目内容和规模" value="${summaryFilter.projectContent}" class="form-control "> --%>
			<textarea class="form-control " rows="5" name="projectContent"
				id="projectContent" placeholder="项目内容和规模">${summaryFilter.projectContent}</textarea>
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			for=projectProgress>项目进展情况</label>
		<div class="col-sm-4">
			<textarea class="form-control " rows="5" name="projectProgress"
				id="projectProgress" 
				placeholder="应简要体现项目重大进展，依次叠加补充，适当控制字数，称谓上应使用第三人称，时间上应使用绝对时间，如12月15日">${summaryFilter.projectProgress}</textarea>
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right" for="area">地区国别</label>
		<div class="col-sm-4">
			<input type="text" name="area" id="area" placeholder=" 请输入国别或地区"
				value="${summaryFilter.area}" class="form-control ">
		</div>

		<label class="col-sm-2 control-label no-padding-right" for=attribute>三维属性</label>
		<div class="col-sm-4">
			<select name="attribute" class="form-control "
				style="width: 100%" data-placeholder="请选择三维属性"
				id="attribute">
				<option value="${summaryFilter.attribute }">${summaryFilter.attribute }</option>
				<option value="国企">国企</option>
				<option value="外企">外企</option>
				<option value="央企">央企</option>
				<option value="民企">民企</option>
			</select>
		</div>
	</div>


	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="industrialClassfly">产业分类</label>
		<div class="col-sm-4">
			<%-- 			<input type="text" name="industrialClassfly" id="industrialClassfly" placeholder="产业分类" value="${summaryFilter.industrialClassfly}" class="form-control "> --%>
			<select name="industrialClassfly" class="form-control "
				style="width: 100%" data-placeholder="请选择产业分类"
				id="industrialClassfly">
				<option value="${summaryFilter.industrialClassfly }">${summaryFilter.industrialClassfly }</option>
				<option value="一产">一产</option>
				<option value="二产">二产</option>
				<option value="三产">三产</option>
			</select>
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			for=industrialConcrete>具体分类</label>
		<div class="col-sm-4">
			<%-- <input type="text" name="industrialConcrete" id="industrialConcrete" placeholder="填写农林水、工业、制造业、能源、大数据物联网、商贸、交通、城市基础设施、旅游、金融业、社会公共事业、服务业" value="${summaryFilter.industrialConcrete}" class="form-control "> --%>
			<select name="industrialConcrete" class="form-control "
				style="width: 100%" data-placeholder="请选择具体分类"
				id="industrialConcrete">
				<option value="${summaryFilter.industrialConcrete }">${summaryFilter.industrialConcrete }</option>

				<option value="农林牧渔业">农林牧渔业</option>
				<option value="工业">工业</option>
				<option value="建筑业">建筑业</option>
				<option value="服务业">服务业</option>
				<option value="金融">金融</option>
				<option value="批发和零售业">批发和零售业</option>
				<option value="仓储和邮政业">仓储和邮政业</option>
				<option value="软件和信息技术">软件和信息技术</option>
				<option value="社会公共事业">社会公共事业</option>
				<option value="物联网">物联网</option>
				<option value="大数据">大数据</option>
				<option value="旅游">旅游</option>
				<option value="文教">文教</option>
				<option value="卫计">卫计</option>
				<option value="其他">其他</option>
			</select>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			   for="totalInver">使用方式：</label>
		<div class="col-sm-4">
			<select name="groundused" class="form-control required"
					style="width: 100%" data-placeholder="请选择土地使用方式"
					id="">
				<option value="${summaryFilter.groundused }">${summaryFilter.groundused}</option>
					<%--<option >请选择</option>--%>
				<option value="供地">供地</option>
				<option value="租赁土地">租赁土地 </option>
				<option value="租赁楼宇">租赁楼宇</option>

			</select>
		</div>

	</div>
	<div class="form-group input-no-wrap">
		<label class="col-sm-2 control-label no-padding-right"
			   for="totalInver">*合计</label>
		<div class="col-sm-4 input-group">

			<input type="number" step="0.01" name="totalInver" id="totalInver" placeholder="合计"
				   value="${summaryFilter.totalInver}" class="form-control "> <span
				class="input-group-addon   ">亿元</span>
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			   for="domesticInver">内资</label>
		<div class="col-sm-4 input-group">

			<input type="number" step="0.01" name="domesticInver" id="domesticInver"
				   placeholder="总投资-内资-(亿元)" value="${summaryFilter.domesticInver}"
				   class="form-control "> <span class="input-group-addon">亿元</span>
		</div>
	</div>

	<div class="form-group input-no-wrap">
		<label class="col-sm-2 control-label no-padding-right"
			   for="foeignInver">外资</label>
		<div class="col-sm-4 input-group">

			<input type="number" step="0.01" name="foeignInver" id="foeignInver"
				   placeholder="总投资-外资-(亿元)" value="${summaryFilter.foeignInver}"
				   class="form-control "> <span class="input-group-addon">万美元</span>
		</div>
	</div>


	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="projectManager">责任人</label>
		<div class="col-sm-4">
			<input type="text" name="projectManager" id="projectManager"
				placeholder=" 请输入责任领导" value="${summaryFilter.projectManager}"
				class="form-control ">
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			for=fenguanLeader>分管领导</label>
		<div class="col-sm-4">
			<input type="text" name="fenguanLeader" id="fenguanLeader"
				placeholder="请输入分管领导" value="${summaryFilter.fenguanLeader}"
				class="form-control ">
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right" for="contacts">联系人</label>
		<div class="col-sm-4">
			<input type="text" name="contacts" id="contacts"
				placeholder=" 请输入联系人（电话）" value="${summaryFilter.contacts}"
				class="form-control ">
		</div>

		<label class="col-sm-2 control-label no-padding-right"
			for=fenguanLeader>备注</label>
		<div class="col-sm-4">
			<input type="text" name="notes" id="notes" placeholder="如需备注请输入"
				value="${summaryFilter.notes}" class="form-control ">
		</div>
	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			for="companyContacts">企业联系人</label>
		<div class="col-sm-4">
			<input type="text" name="companyContacts" id="companyContacts"
				placeholder="请输入企业联系人" value="${summaryFilter.companyContacts}"
				class="form-control ">
		</div>

		<label class="col-sm-2 control-label no-padding-right"  >上报市里时间</label>
		<div class="col-sm-4">
			<div class="row">
				<div class="col-xs-8 col-sm-12">
					<div class="input-group">
						<input type="text" name="reportUrban"  class="form-control date-picker" value="${summaryFilter.reportUrban}" readonly/>
                        <span class="input-group-addon">
										<i class="fa fa-calendar bigger-110"></i>
									</span>
					</div>
				</div>
			</div>
		</div>


	</div>

	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"
			   for="companyContacts">实际个数</label>
		<div class="col-sm-4">
			<input type="number" step="0.01" name="realNum" id="realNum"
				   value="${summaryFilter.realNum}" class="form-control "
			/>
		</div>

		<label class="col-sm-2 control-label no-padding-right" for="realInver">实际金额</label>
		<div class="col-sm-4">
			<input type="number" step="0.01" name="realInver" id="realInver"
				   value="${summaryFilter.realInver}" class="form-control "
			/>
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-2 control-label no-padding-right"  >市考评日期</label>
		<div class="col-sm-4">
			<div class="row">
				<div class="col-xs-8 col-sm-12">
					<div class="input-group">
						<input type="text" name="cityEvaluation"  class="form-control date-picker" value="${summaryFilter.cityEvaluation}" readonly/>
                        <span class="input-group-addon">
										<i class="fa fa-calendar bigger-110"></i>
									</span>
					</div>
				</div>
			</div>
		</div>

		<label class="col-sm-2 control-label no-padding-right"  >企业注册日期</label>
		<div class="col-sm-4">
			<div class="row">
				<div class="col-xs-8 col-sm-12">
					<div class="input-group">
						<input type="text" name="enterpriseDate"  class="form-control date-enter" value="${summaryFilter.enterpriseDate}" readonly  />
                        <span class="input-group-addon">
										<i class="fa fa-calendar bigger-110"></i>
									</span>
					</div>
				</div>
			</div>
		</div>
	</div>

	<!--  		<label class="col-sm-1 control-label no-padding-right" for=registerDate>注册备案时间</label>
		<div class="col-sm-5">
			<input type="text" name="registerDate" id="registerDate" placeholder="请输入注册备案时间" value="${summaryFilter.registerDate}" class="form-control ">
		</div>
	</div>
	
	<div class="form-group">
		<label class="col-sm-1 control-label no-padding-right" for="countyEvaluation">县考评</label>
		<div class="col-sm-5">
			<input type="text" name="countyEvaluation" id="countyEvaluation" placeholder="县考评" value="${summaryFilter.countyEvaluation}" class="form-control ">
		</div>
		
		<label class="col-sm-1 control-label no-padding-right" for=reported>已上报招商办</label>
		<div class="col-sm-5">
			<input type="text" name="reported" id="reported" placeholder="请输入注册备案时间" value="${summaryFilter.reported}" class="form-control ">
		</div>
	</div>
	
	<div class="form-group">
	<%-- 	<label class="col-sm-1 control-label no-padding-right" for="taxproof">佐证材料</label>
		<div class="col-sm-5">
			<input type="text" name="taxproof" id="taxproof" placeholder="税收证明" value="${summaryFilter.taxproof}" class="form-control ">
		</div> --%>
		
		<label class="col-sm-1 control-label no-padding-right" for=investplan>项目投资进度计划表</label>
		<div class="col-sm-5">
			<input type="text" name="investplan" id="investplan" placeholder="项目投资进度计划表" value="${summaryFilter.investplan}" class="form-control ">
		</div>
	</div>-->

	<div class="form-group">



		<label class="col-sm-2 control-label no-padding-right" for="taxproof">佐证材料</label>
		<input class="col-sm-4" type="file" id="fileupload" name="files"
			accept=".zip"/> <br>

		<button class="col-sm-4 btn btn-large btn-primary" id="btn">上传</button>

		<input type="text" name="taxproof" id="taxproof"
			value="${summaryFilter.taxproof}" class="form-control "
			style="display: none" />
		<input type="text" name="isaudit" id="isaudit"
			value="${summaryFilter.isaudit}" class="form-control " style="display: none"
			 />
		<input type="text" name="teamClass" id="teamClass"
			value="${summaryFilter.teamClass}" class="form-control "  style="display: none"
			 />
		<input type="text" name="datatime" id="datatime"
			   value="${summaryFilter.datatime}" class="form-control "  style="display: none"
		/>
		<input type="text" name="firstReportDate" id="firstReportDate"
			   value="${summaryFilter.firstReportDate}" class="form-control "  style="display: none"
		/>
		<input type="text" name="remark"
			   value="${summaryFilter.remark}" class="form-control "  style="display: none"
		/>
	</div>


	<!-- <div class="form-group">
			<label class="col-sm-2 control-label no-padding-right"
			for="optionA">分类</label>
			
	</div>  -->



	<form:hidden path="sysId" />
</form:form>


<script src="<s:url value="/assets/js/chosen.jquery.js"></s:url>"></script>
<script src="<s:url value="/assets/js/ajaxfileupload.js"></s:url>"></script>
<script src="<s:url value="/assets/js/modal/modal.js"></s:url>"></script>
<%--<script src="<s:url value="/assets/js/jquery-ui.js"></s:url>"></script>--%>

<%--<div id="dialog" title="提示">
	<div class="progress progress-striped active">
		<div class="progress-bar progress-bar-success" role="progressbar"
			aria-valuenow="60" aria-valuemin="0" aria-valuemax="100"
			style="width: 100%;"></div>

	</div>
	<p>正在上传 请稍后……</p>
</div>--%>

<script type="text/javascript">

	jQuery(function($) {
		$('.date-picker').datepicker({
					inline: true,
					format:"yyyymmdd",
					autoclose: true,
					todayHighlight: true,
					language: 'cn'
				})
				//show datepicker when clicking on the icon
				.next().on(ace.click_event, function(){
			$(this).prev().focus();
		});
	});

	jQuery(function($) {
		$('.date-enter').datepicker({
					inline: true,
					format:"yyyymmdd",
					autoclose: true,
					todayHighlight: true,
					language: 'cn'
				})
				//show datepicker when clicking on the icon
				.next().on(ace.click_event, function(){
			$(this).prev().focus();
		});
	});

	$('#editor1').ace_wysiwyg({
		toolbar : [ 'font', null, 'fontSize', null, {
			name : 'bold',
			className : 'btn-info'
		}, {
			name : 'italic',
			className : 'btn-info'
		}, {
			name : 'strikethrough',
			className : 'btn-info'
		}, {
			name : 'underline',
			className : 'btn-info'
		}, null, {
			name : 'createLink',
			className : 'btn-pink'
		}, {
			name : 'unlink',
			className : 'btn-pink'
		}, null, {
			name : 'insertImage',
			className : 'btn-success'
		}, null, 'foreColor', null, {
			name : 'undo',
			className : 'btn-grey'
		}, {
			name : 'redo',
			className : 'btn-grey'
		} ]
	});


	$("#btn").click(function() {
		var fileval = $("#fileupload").val();
		if (fileval == null || fileval == "") {
            $(".shade").fadeIn(100);
            $(".warning").fadeIn(100);
            $('.la-square-jelly-box').hide();
            $('.warning>.title>em').html('未选择上传文件');
            showShade();
			return;

		}


        $(".shade").fadeIn(100);
        $(".warning").fadeIn(100);
        $('.la-square-jelly-box').show();
        showShade();
        //警告框自定义内容
        $('.warning>.title>em').html('加载中……');
		$.ajaxFileUpload({
			type : "post",
			fileElementId : "fileupload",
			secureuri : false,
			dataType : 'text',
			url : "/pictureUpload/uploadBatch",
			async : false,
			success : function(data) {
				// var val = data.data.sysid;
				// console.log(val);
				// $("#taxproof").attr("value", val); //taxproof 作为存放作证材料的字段
				// /*$("#dialog").dialog("close");*/
                // $('.warning>.title>em').html('上传成功');
				// $('#btn').html('文件已上传');
                var data=JSON.parse(data);
				console.log(data);
				if(data.code==="200"){
                    $('.warning>.title>em').html('上传成功');
				}else{
                    $('.warning>.title>em').html('上传失败');
                }
            },
			error : function(data) {
				/*$("#dialog").dialog("close");*/

				alert("佐证材料上传失败 ！！请联系管理员");
			}

		});

	});
	
	function inContains(str,substr){
		return str.indexOf(substr)>=0;
	}
	//更新 权限 
	//var projectStage = $("#projectStage").val();
	//console.log(projectStage+"huangyupengshipaowang");
	//var str = "在谈项目,意向项目,评审项目,签约项目";
	//console.log(inContains(str,projectStage));
	/*if(inContains(str,projectStage)){
		$("#updatebtn").attr("disabled", true);
		
	} */

    function findtwoClass() {
        var teamID = $("#team-ClassId").val();
        var teamClassname = $("#team-ClassId").find("option:selected").text();
        $("#teamClass").attr("value",teamClassname);
        //console.log(teamID);
        //alert(teamID);
        var teamcla = {
            "teamId" : teamID
        };

        $.ajax({
            url : "/chart/show/getTeamclassNames",
            dataType : "json", //返回数据形式为json
            type : "POST",
            contentType : 'application/json;charset=UTF-8',
            data : JSON.stringify(teamcla),
            success : function(data) {
                console.log(data);
                $("#team-name option").remove();
               // $("#team-name").append(" <option >请选择</option>");
                for (var i = 0; i < data.data.length; i++) {

                    var teamid = data.data[i].teamId;
                    var teamname = data.data[i].teamName;
                    $("#team-name").append(
                        "<option value='"+teamname+"'>" + teamname
                        + "</option>");
                    //console.log(teamname);
                }
            }
        });

    }
</script>
